/**
 * Copyright (c) 2015-2018, Golly Hu 胡高 (3722711@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.hg.jfsa.web.service.api;

import cn.hg.jfsa.model.Doc;
import cn.hg.jfsa.model.DocCategory;
import com.jfinal.plugin.activerecord.Page;

import java.util.List;
import java.util.Map;

/**
 * 类 {@code DocServiceApi} 文章服务层接口.
 * <p> 主要包括 取得文章分类列表、获取文章分页、获取文章等功能
 * @author <a href="mailto:3722711@qq.com">Golly</a>
 * @since 2018/12/12
 */
public interface DocServiceApi {

	/**
	 * 取得文章分类列表
	 * @param paraMap 参数Map：
	 * <li>code （可选）分类代码</li>
	 * <li>id （可选）分类ID</li>
	 * @return 分类List
	 */
	public List<DocCategory> getDocCategoryList(Map<String, Object> paraMap);

	/**
	 * 获取文章分页
	 *
	 * @param page       页数
	 * @param size       条数
	 * @param paraMap 参数Map：
	 * <li> categoryId （可选）分类ID</li>
	 * <li> title （可选）标题，模糊查询</li>
	 * <li> keyword （可选）关键字，模糊查询</li>
	 * <li> categoryCode （可选）分类代码</li>
	 * <li> categoryName （可选）分类名，模糊查询</li>
	 * @return 文章Page对象
	 */
	Page<Doc> getDocPage(int page, int size, Map<String, Object> paraMap);

	/**
	 * 获取文章
	 * @param id 文章ID
	 * @return 文章实例
	 */
	Doc getDoc(int id);
}
